#!/bin/bash
# 检测到处于failed状态，将会释放VIP，slave机器将会获取VIP。
# 正常退出（活着），异常退出（死了）
if [[ `ps -ef | grep nginx | grep -v grep | wc -l` -ge 2 ]]; then
    echo "活着"
    echo "活着" >> /etc/keepalived/result.log
    exit 0
else 
    echo "死了"
    echo "活着" >> /etc/keepalived/result.log
    exit 1
fi
